package com.moli.iov.handle.alarm.enums;

/**
 * <p>
 *  类型： 1、报警  2、故障
 * </p>
 *
 * @author: zql
 * @Date: 2019/2/18 13:48
 */
public enum AlarmTypeEnum {

    /**
     * 报警
     */
    ALARM(1, "报警"),

    /**
     * 故障
     */
    FAULT(2, "故障");

    private int flag;

    private String msg;

    AlarmTypeEnum(int flag, String msg){
        this.flag = flag;
        this.msg = msg;
    }

    public static String getMsg(int flag){
        for(AlarmTypeEnum e : AlarmTypeEnum.values()){
            if(e.flag == flag){
                return e.msg;
            }
        }
        return "";
    }

    public int getFlag() {
        return flag;
    }

    public String getMsg() {
        return msg;
    }
}
